package com.zxjia.ssmp.controller;


import com.zxjia.ssmp.dto.PayRequest;
import com.zxjia.ssmp.service.PayService;
import com.zxjia.ssmp.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "支付")
@RestController
@RequestMapping(value = "/api/pay")
public class PayController {


    @Autowired
    PayService payService;

    @ApiOperation(value = "付款")
    @PostMapping("/payment")
    public Result<Boolean> payment(@RequestBody @Validated PayRequest payRequest) {
        return Result.success(payService.payment(payRequest));
    }
}
